package com.education.online.controller;


import com.education.common.utils.ApiReturnObject;
import com.education.common.utils.DateUtil;
import com.education.online.pojo.OMsg;
import com.education.online.service.OMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.crypto.Data;
import java.util.List;


/**
 * 消息表
 *
 * @date 2020-06-28 17:01:13
 */

@Api(tags = {"PC--消息表"})
@RestController
@RequestMapping("/online/omsg")
public class OMsgController {

    @Autowired
    private OMsgService oMsgService;


    @ApiOperation(value = "查询全部消息", httpMethod = "GET")
    @GetMapping("/selectAll")
    public ApiReturnObject selectAll() {
        List<OMsg> oMsgs = oMsgService.selectOMsgList(null);
//        for (OMsg oMsg : oMsgs) {
//            oMsg.setSimpleTime(DateUtil.dateFormattime(oMsg.getCreatetime()));
//        }
        return new ApiReturnObject("200", "success", oMsgs);
    }
}
